import Vue from 'vue';
import VueRouter from 'vue-router';

const children = [];
const files = require.context('./module', false, /\.js$/);
files.keys().forEach(key => children.push(files(key).default));

Vue.use(VueRouter)

export default new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes: [{
		path: '/',
		name: 'Home',
		component: () => import('../views/Home.vue'),
		children
	}]
})
